import request from '@/utils/request'

// 获取-部门列表 /company/department
export function companyDepartmentRequest() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 获取部门负责人列表
export function Head() {
  return request({
    url: '/sys/user/simple',
    method: 'get'
  })
}

// 新增部门
export function addANewDepartment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 删除部门
export function deleteADepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 编辑部门
export function editorialDepartment(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 部门详情
export function departmentDetails(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}
